var miniAdd = {
     setFormValue: function (item) {
        var data = this.state.data;
        data[item.name] = item.value;
        this.setState({
            "data": data,
        });

        //console.log(JSON.stringify(this.state))
    },
    changState: function (value) {
        //console.log("shezhi :" + JSON.stringify(value));
        return this.setState(value);
    },
    getState: function (name) {
        return this.state[name];
    },
    vaInData: function (data) {
        var key, state = this.state, temp, newState = {}, isVa = true;

        for (key in state) {
            temp = state[key];
            // && temp.isStar
            if (temp&&temp.title&& temp.errorMessage != true) {

                if(temp.errorMessage==false&&!temp.isStar){
                    console.info("noting to do ")
                }else{
                     temp.errorMessage = temp.errorMessage == false ? "不能为空" : temp.errorMessage;
                     newState[key] = temp;
                     isVa = false;
                }

            }
        }
        this.setState(newState);
        console.info("新增tijiao  say :")
        if (isVa) {
            this.formate(data);
        }
    },
    //提交数据
    postData:function(data){
        this.DataActions.post(this.addUrl,data)
    },
    clone:function(obj){
       return $.extend(true,{} , obj);

    },
}


module.exports = miniAdd;
